package com.touchyourheart.model.bean;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "category")
public class Category implements Serializable {

  private static final long serialVersionUID = 4353261567349337381L;

  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private long id;

  @Column(name = "name", nullable = false, length = 16)
  private String name;

  @Column(name = "eng_name", nullable = true, length = 32)
  private String engName;

  @Column(name = "email", nullable = true, length = 128)
  private String email;

  @Column(name = "reg_date", nullable = false)
  @Temporal(value = TemporalType.TIMESTAMP)
  private Date regDate;

  @OneToMany(mappedBy = "cagetory", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
  private List<CategoryChild> categoryChildList;

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getEngName() {
    return engName;
  }

  public void setEngName(String engName) {
    this.engName = engName;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public Date getRegDate() {
    return regDate;
  }

  public void setRegDate(Date regDate) {
    this.regDate = regDate;
  }

  public List<CategoryChild> getCategoryChildList() {
    return categoryChildList;
  }

  public void setCategoryChildList(List<CategoryChild> categoryChildList) {
    this.categoryChildList = categoryChildList;
  }

}
